package org.linlinjava.litemall.db.dao;

import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.linlinjava.litemall.db.domain.LumiereCouponStrategy;

public interface LumiereCouponStrategyMapper extends MPJBaseMapper<LumiereCouponStrategy> {
    @Delete("delete from lumiere_coupon_strategy where id = #{id}")
    Boolean recycleDelete(Long id);

    @Select("SELECT COALESCE(SUM(total), 0) FROM lumiere_coupon_strategy WHERE deleted = 0")
    Long pullSum();

    @Select("SELECT * FROM lumiere_coupon_strategy WHERE id=#{strategyId} AND deleted = 0")
    LumiereCouponStrategy findByid(Long strategyId);
}
